<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('CakePHP: the rapid development php framework:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('cake.generic');
		echo $this->Html->css('custom');
		echo $this->Html->script('jquery-1.6.4.min');
		echo $this->Html->script('tiny_mce/tiny_mce.js');
		//echo $this->Html->script('jshashtable-2.1');
		//echo $this->Html->script('jquery.numberformatter-1.2.2.min');
		//echo $scripts_for_layout;
	?>
	<script type="text/javascript">

	jQuery(document).ready(function($) {

		
		tinyMCE.init({
			mode : "textareas",
			theme : "advanced",   //(n.b. no trailing comma, this will be critical as you experiment later)
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left"

		});

	});

	</script>
	

</head>
<body>
	<div id="container">
		<div id="header">
			<h1 style="float:left">
				<?php if (!empty($user)) { echo $group["Group"]["name"].": "; }?>				
				<?php echo $this->Html->link(__('CỔNG THÔNG TIN - KINH DOANH & TIẾP THỊ ONLINE', true), ''); ?>
			</h1>
			<div style="float:right">
				<?php if (!empty($user)) { ?>
					Chào, <?php echo $user['username']; ?>!
					  <?php
					  echo $this->Html->link('Thoát', array('plugin'=>null, 
					'admin'=>false, 'controller'=>'users', 'action'=>'logout'));
					} else {
					  echo $this->Html->link('Đăng nhập', array('plugin'=>null, 
					'admin'=>false, 'controller'=>'users', 'action'=>'login'));
					}
				?>
			</div>
		</div>		
		<div id="content">	
			
			<div id="main_nav" style="clear:both;float:left;margin-bottom:20px">
				<?php if (!empty($user) && $group["Group"]["id"] == 1) { ?>
					<div class="" style="float:left;margin-bottom:20px;border-left:solid 2px #ccc;padding-left:10px;">
						<h3><?php __('Quản trị danh mục'); ?></h3>
						<ul>						
							<li><?php echo $this->Html->link(__('Tỉnh/Thành', true), array('controller' => 'cities', 'action' => 'index', 'admin'=>true)); ?></li>
							<li><?php echo $this->Html->link(__('Quận/Huyện', true), array('controller' => 'districts','action' => 'index', 'admin'=>true)); ?></li>
							<li><?php echo $this->Html->link(__('Ngành nghề', true), array('controller' => 'careers','action' => 'index', 'admin'=>true)); ?></li>
							<li><?php echo $this->Html->link(__('Loại NCDT', true), array('controller' => 'types','action' => 'index', 'admin'=>true)); ?></li>
						</ul>
					</div>
				<?php } ?>
				
				<?php if (!empty($user) && in_array($group["Group"]["id"],array(1,2))) { ?>
					<div class="" style="float:left;margin-bottom:20px;border-left:solid 2px #ccc;padding-left:10px;padding-left:10px;">
						<h3><?php __('Cổng thông tin'); ?></h3>
						<ul>						
							<li <?php if(($this->params['controller'] == 'publicprices')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Giá cả thị trường', true), array('controller' => 'publicprices', 'admin'=>true)); ?> </li>
							<li <?php if(($this->params['controller'] == 'shoppinginfos')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Thông tin mua sắm', true), array('controller' => 'shoppinginfos', 'admin'=>true)); ?> </li>
							<li <?php if(($this->params['controller'] == 'ncdts')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Nhà phân phối', true), array('controller' => 'ncdts', 'admin'=>true)); ?> </li>
							<li <?php if(($this->params['controller'] == 'newproducts')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Sản phẩm mới', true), array('controller' => 'newproducts', 'admin'=>true)); ?> </li>
							<li <?php if(($this->params['controller'] == 'nhucaumuas')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Nhu cầu mua', true), array('controller' => 'nhucaumuas', 'admin'=>true)); ?> </li>
							<li <?php if(($this->params['controller'] == 'nhucaubans')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Nhu cầu bán', true), array('controller' => 'nhucaubans', 'admin'=>true)); ?> </li>
							
							<li <?php if(($this->params['controller'] == 'projectinfos')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Nhịp cầu đầu tư', true), array('controller' => 'projectinfos', 'admin'=>true)); ?> </li>
							
							
						</ul>
					</div>
					
				<?php } ?>
				<?php if (!empty($user) && in_array($group["Group"]["id"],array(1,2))) { ?>
					<div class="" style="float:left;margin-bottom:20px;border-left:solid 2px #ccc;padding-left:10px;padding-left:10px;">
						<h3><?php __('Tự giới thiệu'); ?></h3>
						<ul>						
							<!--<li <?php if(($this->params['controller'] == 'resourceinfo_types')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Loại giới thiệu', true), array('controller' => 'resourceinfo_types', 'admin'=>true)); ?> </li>-->
							<li <?php if(($this->params['controller'] == 'resourceinfos')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Tin giới thiệu', true), array('controller' => 'resourceinfos', 'admin'=>true)); ?> </li>
							
							
							
						</ul>
					</div>
					
				<?php } ?>
				<?php if (!empty($user) && in_array($group["Group"]["id"],array(1,2))) { ?>
					<div class="" style="float:left;margin-bottom:20px;border-left:solid 2px #ccc;padding-left:10px;padding-left:10px;">
						<h3><?php __('Thị trường lao động'); ?></h3>
						<ul>
							<!--<li <?php if(($this->params['controller'] == 'recruitment_types')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Loại tuyển dụng', true), array('controller' => 'recruitment_types', 'admin'=>true)); ?> </li>-->
							<li <?php if(($this->params['controller'] == 'recruitments')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Tin tuyển dụng', true), array('controller' => 'recruitments', 'admin'=>true)); ?> </li>
								<!--<li <?php if(($this->params['controller'] == 'apply_types')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Loại tìm việc', true), array('controller' => 'apply_types', 'admin'=>true)); ?> </li>-->
							<li <?php if(($this->params['controller'] == 'applies')) echo ' class="activelink"'; ?>>
								<?php echo $this->Html->link(__('Tin tìm việc', true), array('controller' => 'applies', 'admin'=>true)); ?> </li>
							
							
							
							
						</ul>
					</div>
					
				<?php } ?>
			</div>

			<?php echo $this->Session->flash(); ?>
			<?php echo $this->Session->flash('auth'); ?>

			<?php echo $content_for_layout; ?>			

		</div>
		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>
	</div>
	<?php //echo $this->element('sql_dump'); ?>
</body>
</html>